<div class="content">
<h2>Einkaufsliste</h2>
<?php print $this->notice($this->message); ?>
<p>Wenn du alle gewünschten Rezepte angibst, kann der cocktailberater
ermitteln, welche Zutaten du dafür brauchst.</p>
<form id="recipe2ingredient" name="recipe2ingredient" method="post"
	action="<?php echo $this->url(array('module'=>'website','controller'=>'portal','action'=>'meine-einkaufsliste-erstellen')); ?>?format=<?php print $this->format; ?>">
<p class="pink clear" 
style="margin-bottom: 0.2em; font-weight: normal; margin-top: 1em;">Cocktailrezepte <?php if($this->format=='html') { ?><span 
 class="link pointer category_select"
 onclick="dojo.query('.recipe_item').forEach(function(e){ e.checked=true; }); dojo.query('.category_select').toggleClass('hide');">(alle auswählen)</span><span 
 class="link pointer category_select hide" id="category_unselect"
 onclick="dojo.query('.recipe_item').forEach(function(e){ e.checked=false; }); dojo.query('.category_select').toggleClass('hide');">(alle abwählen)</span><?php } ?></p>
<ul class="clear no-bullet two_column" style="margin-top: 0.5em; margin-left: 0;">
<?php
$recipes=Website_Model_Recipe::searchByName('%');
foreach($recipes as $recipe){
	if ($this->einkaufsliste->hasRecipe(Website_Model_CbFactory::factory('Website_Model_Recipe',$recipe->id))) {
		$checked='checked="checked"';
	} else {
		$checked='';
	}
	print stripslashes("<li style=\"margin-bottom: 0.4em; -webkit-column-break-inside: avoid; -webkit-break-inside:avoid-column; break-inside: avoid-column;\">".
			"<input type=\"checkbox\" name=\"recipe2ingredient[]\" class=\"recipe_item\" ". 
			"value=\"$recipe->id\" $checked id=\"recipe_{$recipe->id}\" /> ".
			"<label style=\"-webkit-column-break-inside: avoid; -webkit-break-inside:avoid-column; break-inside: avoid-column; \" for=\"recipe_{$recipe->id}\">$recipe->name</label>".
			"</li>");
}
?>
</ul>
 <input style="margin-top: 1em; margin-bottom: 1em;" class="pink right" type="submit"
	value="Was brauche ich dafür?" name="submit_recipe2ingredient" /> <input
	style="margin-top: 1em; margin-bottom: 1em;" type="submit" class="grey left"
	value="zurücksetzen" name="reset_recipe2ingredient" /></form>
</div>
